package main;

import java.util.Calendar;


/**
 * 
 *
 * @author xlouwette
 * @version $Revision:$ $Date:$ $Author:$
 */

public class SRTRecord implements Comparable<SRTRecord>{

    private int numOfSub;
    private Calendar startTimeOfSub;
    private Calendar endTimeOfSub;
    private String subtitleText="";

    /**
     * Getter 
     * @return the number of subtitle
     */
    public int getNumOfSub() {
        return numOfSub;
    }
    
    /**
     * Setter
     * @param numOfSub the number of subtitle
     */
    public void setNumOfSub(int numOfSub) {
        this.numOfSub = numOfSub;
    }
    
    /**
     * Getter
     * @return the start time of subtitle
     */
    public Calendar getStartTimeOfSub() {
        return startTimeOfSub;
    }
    
    /**
     * Setter
     * @param startTimeOfSub the start time of subtitle 
     */
    public void setStartTimeOfSub(Calendar startTimeOfSub) {
        this.startTimeOfSub = startTimeOfSub;
    }
    
    /**
     * Getter
     * @return the end time of subtitle
     */
    public Calendar getEndTimeOfSub() {
        return endTimeOfSub;
    }
    
    /**
     * Setter
     * @param endTimeOfSub the end time of subtitle
     */
    public void setEndTimeOfSub(Calendar endTimeOfSub) {
        this.endTimeOfSub = endTimeOfSub;
    }
    
    /**
     * Getter
     * @return return the subtitle text
     */
    public String getSubtitleText() {
        return subtitleText;
    }
    
    /**
     * Setter 
     * @param subtitleText the subtitle text
     */
    public void setSubtitleText(String subtitleText) {
        this.subtitleText = subtitleText;
    }
    
    /**
     * {@inheritDoc}
     */
    public int compareTo(SRTRecord o) {
        if(this.getNumOfSub() == o.getNumOfSub()){
            return 0;
        }
        else{
            if(this.getNumOfSub() > o.getNumOfSub()){
                return 1;
            }
            else{
                return -1;
            }
        }
    }

}
